<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            width:100px;
            height:100px;
            background:#f00;
            margin-top:50px;
        }
    </style>
</head>
<body>
    <div style="background:#00a">盒子1</div>
    <div>盒子2</div>
    <div>盒子3</div>
    <script src="/jquery.js"></script>
    <script>
        //读取样式，如果有多个元素，只获取第一个元素的样式
        console.log( $('div').css('background-color') );

        //设置样式，如果有多个元素，全部生效
        $('div').css('background','pink');
    </script>
</body>
</html>